package encapsulation;

public class Person {
    private int age;
    public void setAge(int a){
        if(a>=0&&a<=130){
            age=a;
        }else {
            System.out.println("输入的年龄非法");
        }
    }
    public int getAge(){
        return age;
    }

}
